/*
** Copyright (C) 2011 Viens Yann
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; either
** version 2.1 of the License, or (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public
** License along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef BREAKOUTLEVELLOADER_HPP_
# define BREAKOUTLEVELLOADER_HPP_

# include <list>
# include <string>
# include <fstream>
# include "Brick.hpp"

class	BreakOutLevelLoader
{
public:
  typedef void (BreakOutLevelLoader::*memberPointer)(std::string const& line);

  BreakOutLevelLoader();
  ~BreakOutLevelLoader();
  std::list<Brick*>*	loadLevel(std::string const& fileName, const int winWidth, const int winHeight);

  void			getInfos(const int nbLines, memberPointer member);
  void			getDimensions(std::string const& line);
  void			getBrick(std::string const& line);

private:
  std::ifstream		_reader;
  int			_winWidth;
  int			_winHeight;
  int			_divWidth;
  int			_divHeight;
  std::list<Brick*>*	_brickList;
};

#endif // !BREAKOUTLEVELLOADER_HPP_
